package cn.janyd.common.core.vo;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * @author janyd
 * @since 2020/8/14 20:48
 */
@Data
@ApiModel("分页参数")
public class PageQuery<T> {

    @ApiModelProperty("页码")
    @NotNull(message = "{page.number.must.be.not.null}")
    @Min(value = 1, message = "{page.number.must.greater.than.or.equal.one}")
    private Integer page;

    @ApiModelProperty("页数")
    @NotNull(message = "{page.size.must.be.not.null}")
    @Range(min = 1, max = 100, message = "{page.size.must.be.range.1.to.100}")
    private Integer size;

    @ApiModelProperty("参数")
    private T param;

}
